<template>

  <el-menu :default-openeds="opens"
           style="min-height: 100vh; overflow-x: hidden;height: 500px"
           background-color="rgb(48,65,86)"
           text-color="white"
           active-text-color="#ffd04b"
           :collapse-transition="false"
           :collapse="isCollapse"
           router
  >
    <div style="height: 60px; line-height: 60px;text-align: center">
<!--      <img src="../assets/img_1.png" alt="" style="width: 25px; position: relative; top: 7px;margin-right: 5px">-->
      <b style="color:white" v-show="logoTextShow">某某招标报名</b>
    </div>
    <div v-for="menu in menus" :key="menu.menuId">
      <div v-if="menu.menuUrl">
        <el-menu-item :index="menu.menuUrl">
          <i :class="menu.menuIcon"></i>
          <span v-show="logoTextShow">{{menu.menuName}}</span>
        </el-menu-item>
      </div>
      <div v-else>
        <el-submenu :index="menu.menuId">
          <template slot="title">
            <i :class="menu.menuIcon"></i>
            <span v-show="logoTextShow">{{menu.menuName}}</span>
          </template>
          <div v-for="subMenu in menu.children" :key="subMenu.menuId">
            <div v-if="subMenu.menuUrl">
              <el-menu-item :index="subMenu.menuUrl">
                <i :class="subMenu.menuIcon"></i>
                <span slot="title">{{subMenu.menuName}}</span>
              </el-menu-item>
            </div>
            <div v-else>
              <el-submenu :index="subMenu.menuId">
                <template slot="title">
                  <i :class="subMenu.menuIcon"></i>
                  <span>{{ subMenu.menuName }}</span>
                </template>
                <div v-for="thirdMenu in subMenu.children" :key="thirdMenu.menuId">
                  <el-menu-item :index="thirdMenu.menuUrl">
                    <i :class="thirdMenu.menuIcon"></i>
                    <span slot="title">{{ thirdMenu.menuName }}</span>
                  </el-menu-item>
                </div>
              </el-submenu>
            </div>
          </div>
        </el-submenu>
      </div>
    </div>
  </el-menu>
</template>


<script>
export default {
  name: "BossmanAside",
  props: {
    isCollapse: Boolean,
    logoTextShow: Boolean,
  },
  data() {
    return {
      menus: localStorage.getItem('menus') ? JSON.parse(localStorage.getItem('menus')) : [],
      opens: localStorage.getItem('menus') ? JSON.parse(localStorage.getItem('menus')).map(v => v.menuId) : [],
    }
  },
  methods: {
  }
}
</script>


<style scoped>

</style>